
*Set working directory
cd ""

use datasets\protak_data.dta, clear 
 
//// Analyses: Threat and Landed Interests Hypotheses (no evidence)

estimates clear

global controllist c_share_enfranchised nobility incumbent  secure

eststo strikes_c	: logistic pro_tak c_tot_strikes 	 						///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo manuf_c	: logistic pro_tak c_share_manufacturing  	 					///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo manuf_agri_c : logistic pro_tak c_share_man_agri 						///
$controllist, vce(robus)
qui estadd local controls 		"Yes"
vif, uncentered

eststo landin_c	: logistic pro_tak c_landineq 	 								///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo land_c	: logistic pro_tak c_share_landowners 	 						///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo all1_c	: logistic pro_tak c_share_manufacturing c_tot_strikes c_landineq c_share_landowners ///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo all2_c	: logistic pro_tak c_share_man_agri c_tot_strikes c_landineq c_share_landowners ///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered


*Show Table (Table 3)
esttab strikes_c manuf_c landin_c land_c all1_c  , ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_tot_strikes c_share_manufacturing c_landineq c_share_landowners c_share_enfranchised nobility incumbent secure )	label ///
	refcat(share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) )

*Export Table (for overleaf)	
esttab strikes_c manuf_c landin_c land_c all1_c  using output/result_threatland.tex, replace ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_tot_strikes c_share_manufacturing c_landineq c_share_landowners c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) ///
	booktabs

	
/// Robustness 1: With share of workers in manufacturing AND agriculture
esttab manuf_agri_c all2_c , eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_share_man_agri c_tot_strikes c_landineq c_share_landowners c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) 

esttab manuf_agri_c all2_c  using output/result_threatland_managri.tex, replace ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_share_man_agri c_tot_strikes c_landineq c_share_landowners c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) ///
	booktabs
	
/// robustness 2: With all independent variables 

estimates clear

global controllist c_wealth c_petition c_share_enfranchised nobility incumbent secure 

eststo strikes_c	: logistic pro_tak c_tot_strikes 	 						///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo threat_c	: logistic pro_tak c_share_manufacturing  	 					///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo landin_c	: logistic pro_tak c_landineq 	 								///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo land_c	: logistic pro_tak c_share_landowners 	 						///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

eststo all_c	: logistic pro_tak c_tot_strikes c_share_manufacturing c_landineq c_share_landowners ///
$controllist, vce(robust)
qui estadd local controls		"Yes"	 
vif, uncentered

*Show Table
esttab strikes_c threat_c landin_c land_c all_c  , ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_tot_strikes c_share_manufacturing c_landineq c_share_landowners c_wealth c_petition c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_wealth "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) )

*Export Table 	
esttab threat_c landin_c land_c all_c  using output/result_threatland_allindep.tex, replace ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_share_manufacturing c_landineq c_share_landowners c_wealth c_petition c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_wealth "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) ///
	booktabs

/// robustness 3: absolute numbers of manufacturing workers and landowners (logged)
 
label var c_logged_manuf		"Workers in manuf. employment (logged)"
label var c_logged_landowners 	"Owners mining or agriculture (logged)"

estimates clear
global controllist c_share_enfranchised nobility incumbent secure 

*Analyses 
eststo threat_c	: logistic pro_tak c_logged_manuf  	 $controllist 				, vce(robust)
vif, uncentered
eststo land_c	: logistic pro_tak c_logged_landowners  $controllist 					, vce(robust)
vif, uncentered
eststo th_la_c	: logistic pro_tak c_logged_manuf c_logged_landowners c_landineq c_tot_strikes $controllist , vce(robust)
vif, uncentered
	
*Show Table	
esttab threat_c land_c th_la_c  , ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_logged_manuf c_logged_landowners c_landineq c_tot_strikes c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) 	
	
*Export Table 
esttab threat_c land_c th_la_c  using output/robustness_threatland.tex, replace ///
	eform  eqlabels(none) b(3) se(3) star(+ 0.1 * 0.05 ** 0.01 *** 0.001) varwidth(30) pr2 nomtitle nonote ///
	order(c_logged_manuf c_logged_landowners c_landineq c_tot_strikes c_share_enfranchised nobility incumbent secure )	label ///
	refcat(c_share_enfranchised "\textbf{Controls}", nolab) ///
	stats(r2_p ll aic bic chi2 N, labels("Pseudo \text{R}^{2}" "Log-Likelihood" "AIC" "BIC" "Wald-Chi^{2}" "Observations"  ) fmt(3 3 3 3 3 0) ) ///
	booktabs
	
			
